package com.uziot;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Callable;

/**
 * @author shidt
 * @version V1.0
 * @className task
 * @date 2020-06-13 22:33:39
 * @description
 */
@Slf4j
public class Task implements Callable<Boolean> {
    int times = 1;
    @Override
    public Boolean call() throws Exception {
        log.info("call times={}", times);
        times++;

        if (times == 2) {
            throw new NullPointerException();
        } else if (times == 3) {
            throw new Exception();
        } else if (times == 4) {
            throw new RuntimeException();
        } else return times != 5;
    }
}
